<template>  
  <div>  
    <h2>Delete Item</h2>  
    <p>Are you sure you want to delete item with ID: {{ id }}?</p>  
    <button @click="confirmDelete">Yes</button>  
    <button @click="cancelDelete">No</button>  
  </div>  
</template>  
  
<script>  
export default {  
  props: ['id'],  
  methods: {  
    confirmDelete() {  
      // 这里可以发送请求到服务器删除数据  
      // 假设删除成功，直接返回并更新列表组件的数据  
      this.$emit('delete', this.id);  
      this.$router.go(-1); // 返回上一页  
    },  
    cancelDelete() {  
      this.$router.go(-1); // 返回上一页  
    }  
  }  
};  
</script>